objects = barter_market.o building_type.o button.o camera.o citizen.o city.o city_dialog.o city_history_dialog.o city_summary_dialog.o dialog.o draw_world.o filesystem.o font.o formula.o formula_function.o formula_tokenizer.o gamemap.o game_logic.o geometry.o government.o government_summary_dialog.o grid_widget.o heightmap.o hex_geometry.o image_widget.o input.o item.o item_type.o job.o joystick.o key.o label.o line_chart_widget.o main.o map_display.o mapgen.o merchant.o model.o money_market.o occupation.o pathfind.o path_cost_calculators.o path_utils.o project.o raster.o resource.o river.o sdl_algo.o sound.o string_utils.o surface_cache.o surface_formula.o surface.o terrain.o terrain_improvement.o texture.o tile.o tile_logic.o tile_corner_logic.o tooltip.o translate.o unit.o unit_summary_dialog.o unit_type.o variant.o widget.o wml_node.o wml_parser.o wml_utils.o wml_writer.o world.o world_generator.o

formula_test_objects = filesystem.o formula_function.o formula_tokenizer.o string_utils.o variant.o wml_node.o wml_parser.o wml_utils.o wml_writer.o

%.o : %.cpp
	g++ -Werror -pg -g -O2 -I/usr/local/include/boost-1_34 `sdl-config --cflags` -I/usr/X11R6/include -D_GNU_SOURCE=1 -D_REENTRANT -Wnon-virtual-dtor -Wreturn-type -c $<

game: $(objects)
	g++ -pg -g -O2 -L/sw/lib --L/usr/X11R6/lib -lX11 `sdl-config --libs` -D_GNU_SOURCE=1 -D_REENTRANT -Wnon-virtual-dtor -Wreturn-type -L/usr/lib -lSDLmain -lSDL -lGL -lGLU -lSDL_image -lSDL_ttf -lSDL_mixer -lboost_regex *.o -o game

formula_test: $(formula_test_objects)
	g++ -O2 -g -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -DUNIT_TEST_FORMULA -Wnon-virtual-dtor -Wreturn-type -L/usr/lib -lSDL -lGL -lGLU -lSDL_image -lSDL_ttf -lSDL_mixer -lboost_regex formula.cpp $(formula_test_objects) -o test

clean:
	rm *.o game
